The Giant ^^^^^ **Definition:** * Many assertions in a single test case **Code Example:** .. code-block:: javascript test('should setup middleware', async () => { const nuxt = createNuxt() const server = new Server(nuxt) server.useMiddleware = jest.fn() server.serverContext = { id: 'test-server-context' } await server.setupMiddleware() expect(server.nuxt.callHook).toBeCalledTimes(2) expect(server.nuxt.callHook).nthCalledWith(1, 'render:setupMiddleware', server.app) expect(server.nuxt.callHook).nthCalledWith(2, 'render:errorMiddleware', server.app) expect(server.useMiddleware).toBeCalledTimes(4) expect(serveStatic).toBeCalledTimes(2) expect(serveStatic).nthCalledWith(1, 'resolve(/var/nuxt/src, var/nuxt/static)', server.options.render.static) expect(server.useMiddleware).nthCalledWith(1, { dir: 'resolve(/var/nuxt/src, var/nuxt/static)', id: 'test-serve-static', prefix: 'test-render-static-prefix' }) expect(serveStatic).nthCalledWith(2, 'resolve(/var/nuxt/build, dist, client)', server.options.render.dist) expect(server.useMiddleware).nthCalledWith(2, { handler: { dir: 'resolve(/var/nuxt/build, dist, client)', id: 'test-serve-static' }, path: '__nuxt_test' }) const nuxtMiddlewareOpts = { options: server.options, nuxt: server.nuxt, renderRoute: expect.any(Function), resources: server.resources } expect(nuxtMiddleware).toBeCalledTimes(1) expect(nuxtMiddleware).toBeCalledWith(nuxtMiddlewareOpts) expect(server.useMiddleware).nthCalledWith(3, { id: 'test-nuxt-middleware', ...nuxtMiddlewareOpts }) const errorMiddlewareOpts = { resources: server.resources, options: server.options } expect(errorMiddleware).toBeCalledTimes(1) expect(errorMiddleware).toBeCalledWith(errorMiddlewareOpts) expect(server.useMiddleware).nthCalledWith(4, { id: 'test-error-middleware', ...errorMiddlewareOpts }) }) **References:** .. admonition:: Quality attributes * :octicon:`file-code;1em` - Code Example * :octicon:`comment-discussion;1em` - Cause and Effect * :octicon:`graph;1em` - Frequency * :octicon:`sync;1em` - Refactoring * `Anti-Patterns - Digital Tapestry `_ * `Categorising Test Smells `_ :octicon:`graph;1em` * `Smells in software test code: A survey of knowledge in industry and academia `_ * `TDD anti patterns - Chapter 1 `_ :octicon:`file-code;1em` * `TDD anti-patterns - the liar, excessive setup, the giant, slow poke `_ :octicon:`file-code;1em` * `Test-Driven Development: TDD Anti-Patterns `_ * `Unit Testing Anti-Patterns, Full List `_ * `Unit testing Anti-patterns catalogue `_